home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / networking / short_timeout / hrq.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1994-08-02  |  1.3 KB  |  39 lines

  1. #!/bin/sh
  2.  
  3. #  Copyright 1994, Silicon Graphics, Inc. 
  4. #  All Rights Reserved.
  5.  
  6. #  This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  7. #  the contents of this file may not be disclosed to third parties, copied or 
  8. #  duplicated in any form, in whole or in part, without the prior written 
  9. #  permission of Silicon Graphics, Inc.
  10.  
  11. #  RESTRICTED RIGHTS LEGEND:
  12. #  Use, duplication or disclosure by the Government is subject to restrictions 
  13. #  as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  14. #  and Computer Software clause at DFARS 252.227-7013, and/or in similar or 
  15. #  successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - 
  16. #  rights reserved under the Copyright Laws of the United States.
  17.  
  18.  
  19. #  hrq.sh is an example of a shell script that uses the program hrq.
  20. #  hrq is like a short timeout version of ping.  It determines quickly
  21. #  whether a host will respond to network communication.  In this
  22. #  example, the script checks for each host named in the command line
  23. #  whether the host will respond quickly before it attempts to run a
  24. #  remote shell command on that host.
  25.  
  26. #  Author:  Aaron Schuman
  27.  
  28.  
  29. HRQDIR=.
  30.  
  31. for host in $*;do
  32.     if $HRQDIR/hrq $host > /dev/null; then
  33.         rsh guest@$host uname -a
  34.     else
  35.         echo $host not responding
  36.     fi
  37. done
  38.  
  39.